<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<html>
<head>
    <meta charset=utf-8"/>
    <title>用户列表</title>
    <script type="text/javascript">
        $().ready(function () {
            //设置分页要跳转到的url
            $("body").data("url", "${pageContext.request.contextPath}/basedata/user/list");
            //声明分页的事件
            GylUtils.basedata.initEvent();
            //声明删除的事件
            /* GylUtils.basedata.deleteObj.deleteFunction({
             id:'deleteSome',
             checkboxname:'ids',
             controlCheckBox:'controlCheckbox',
             url:'departmentAction_deleteDepartments.action'
             }); */
            $.deleteObjForm();
            //声明修改的事件
            GylUtils.basedata.updateObj.updateFunction({
                url: '${pageContext.request.contextPath}/basedata/user/update',
                id: 'uid'
            });
        });
    </script>
</head>
<body>
<form action="${pageContext.request.contextPath}/basedata/user/deleteUser">
    <table id="userwrap">
        <tr class="user">
            <td class="right">
                <table cellspacing="0" cellpadding="0" id="maintain-top" align="center" width="900"
                       style=" overflow:auto; height:40px;">
                    <tr class="one" style="height: 20px">
                        <!--
                        <td class="btn" align="left"><input type="button" value="删除" id="deleteSome"/></td>
                        -->
                        <td class="btn" align="left"><input type="submit" value="删除" id="deleteSome"/></td>
                    </tr>
                    <tr class="one" style="height: 20px">
                        <td><input type="checkbox" id="controlCheckbox"/></td>
                        <td width="300">用户名</td>
                        <td width="300">email</td>
                        <td width="300">phone</td>
                        <td width="300">sex</td>
                        <td width="300">部门</td>
                        <td width="400">操作</td>
                    </tr>
                    <c:forEach var="user" items="${requestScope.users.rows}">
                        <tr align="center">
                            <td><input type="checkbox" name="ids" value="${user.uid}"/></td>
                            <td>${user.username}</td>
                            <td>${user.email}</td>
                            <td>${user.phone}</td>
                            <td>${user.sex}</td>
                            <td>${user.department.name}</td>
                            <td class="btn" align="center">
                                <input type="button" value="修改"/>
                                <input type="button" value="删除"/>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
                <p style="width:900px; height:20px;font-size:12px;">
	<span class="page" style="float:right">
		<input type="button" param="1" flag="firstPage" value="首页"/>&nbsp;<input type="button" flag="prePage"
                                                                                 param="${requestScope.users.pageNum-1}"
                                                                                 value="上一页"/>&nbsp;<input type="button"
                                                                                                           param="${requestScope.users.pageNum+1}"
                                                                                                           flag="nextPage"
                                                                                                           last="${requestScope.users.totalPages}"
                                                                                                           value="下一页"/>&nbsp;
        <input type="button" param="${requestScope.users.totalPages}" flag="lastPage" value="尾页"/>&nbsp;<span>转到第<input
            name="basedataQuery.currentPage" id="pageNo" type="text" value="${basedataQuery.currentPage}" size="4"
            style="height:16px; width:28px; border:1px solid #999999; background:#FFF; border-radius:0;"/>页 </span>&nbsp;&nbsp;
        <input type="button" value="转" style=" padding:0 10px;"/>
	</span>&nbsp;&nbsp;共有${requestScope.users.totalRows}条记录，当前第 ${requestScope.users.pageNum}/${requestScope.users.totalPages}页</p>
            </td>
        </tr>
    </table>
</form>
<div>
    <a href="${sessionScope.path}/basedata/user/add">
        <img src="${pageContext.request.contextPath}/images/createNew.png"/>
    </a>
</div>
</body>
</html>